#get all files and filter it for files without or negative duration import ox api = ox.API('http://archive.arabdigitalexpression.org/api/') data = api.findMedia (query={'conditions': []}, keys=['id', 'path', 'duration'], range=[0, 100000])['data']['items'] no_duration = filter(lambda f: (f['duration'] or -1) < 0, data) print no_duration data = api.findMedia(query={'conditions': [{'key': 'duration', 'value': 0, 'operation': '<'}]}, keys=['id', 'path', 'duration'], range=[0, 100000])['data']['items'] add = lambda a,b: a+b add(1, 2) == 3